<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
 <%!public String codeToString(String str){
   String s=str;
   try{
   byte tempB[]=s.getBytes("ISO-8859-1");
   s=new String(tempB);
   return s;
   }catch(Exception e){
   return s;
   } 
   } %>
<%
String message=(String)request.getAttribute("error");
if(message == null){
	message = "";
}
if (!message.trim().equals("")){
out.println("<script language='javascript'>");
out.println("alert('"+message+"');");
out.println("</script>");
}
request.removeAttribute("message");
%>
<style>
		.btn{
			display:block;
			width:60px;
			background:#ffffff;
			color:#000000;
			text-align:center;
			text-decoration:none;
			font-size:18px;
		}
	</style>
<script>
	function validate_form(){
		var userName=document.getElementById('userName').value;
		var password=document.getElementById('password').value;
			if(userName==""){
				alert('用户名不能为空');
				return false;
				}
			if(password==""){
				alert('密码不能为空');
				return false;
		}
		}
</script>
  
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>login</title>
          <link type="text/css" rel="stylesheet" media="all" href="css/login.css">
        </head>
    <body class="index">
        <div class="login_box" align="right">
           <form action="login.do" name="form1" method="post"  onsubmit="return validate_form()" style="height: 250px; ">
            <table class="login_table" align="center">
                <tr>
                    <td class="login_info" align="right">用户名：</td>
                    <td colspan="2"><input id="userName" name="userName" value="" type="text" class="width150"/></td>
                </tr>
                <tr>
                    <td class="login_info" align="right">密码：</td>
                    <td colspan="2"><input id="password" name="password" value="" type="password" class="width150"/></td>
                    <td class="jizhumima">
                    <input id="remberRB" type="checkbox" name="" value="jizhumima">
                    <label for="remberRB">记住密码</label>
                    </td>
                </tr>         
                <tr>
                    <td></td>
                    <td class="login_button" colspan="2" style="width: 51px;">
                        <input align="middle" class="btn" type="submit" onclick="return validate_form()" name="" value="登录"/>
                    </td>
                          <td> <a href="user/regist.jsp">注册用户？</a>
                          </td>      
                </tr>
            </table>
           </form> 
        </div>
    </body>
</html>

